$(function(){
	$('#generateCodeConfigForm').validate();
});

function generateCode(){

	if($('#generateCodeConfigForm').valid()){
		$.ajax({
			type: 'post',
			url: '/generator/generateCode',
			data: $('#generateCodeConfigForm').serialize(),
			dataType: 'json',
			success: function(response){

				if(response.success){

        			window.location.href = '/generator/downloadZip?fileName=' + response.data;
        		}
        		else{

        			modalAlert(response.message);
        		}
				forwardPage('/tableConfig/init');
			}
		});
	}

}

function moduleNameChange(obj){

	var value = $(obj).val();

	$('#sqlBasePackageForModule').text('/' + value);
	$('#pageBasePackageForModule').text('/' + value);
}
